<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="swiper/swiper-bundle.min.css">
    <script src="swiper/swiper-bundle.min.js"></script>
    <style>
        .swiper {
            width: 600px;
            height: 300px;

        }

        .swiper-slide:nth-child(1){
            background: red;
        }
        .swiper-slide:nth-child(2) {
            background: green;
        }
        .swiper-slide:nth-child(3) {
            background: yellow;
        }
        .swiper-slide:nth-child(4) {
            background: hotpink;
        }
        .swiper-slide:nth-child(5) {
            background: yellow;
        }
    </style>
</head>

<body>
    <div class="swiper">
        <div class="swiper-wrapper">
            <div class="swiper-slide">Slide 1</div>
            <div class="swiper-slide">Slide 2</div>
            <div class="swiper-slide">Slide 3</div>
            <div class="swiper-slide">Slide 4</div>
            <div class="swiper-slide">Slide 5</div>
        </div>

        <!-- 分页器 -->
        <div class="swiper-pagination"></div>

        <!-- 前后两个按钮 -->
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>
    </div>
    <script>
        new Swiper(".swiper", {
            // direction:"vertical",//轮播轮播方向
            pagination: {
                el: '.swiper-pagination',
                clickable: true
            },
            autoplay: {
                delay: 1000,//1s轮播一次
                stopOnLastSlide: true,//是否停留在最后一个滑块上
                disableOnInteraction: true,//操作过滑块是否自动播放
            },
            // loop: true,
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },
            // slidesPerView:2,//同一个页面展示几个滑块
            // effect:"cards"//切换效果
        });
    </script>
</body>

</html>